body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f0f2f5;
  display: flex;
  flex-direction: column;
  height: 100%;
  /* overflow: hidden; */
}

/* Top Status Bar */
.top-status-bar {
  background-color: #3f51b5;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  flex-shrink: 0; /* 确保它不收缩，保持固定高度 */
  box-sizing: border-box; /* 确保 padding 不会撑大高度 */
}

.top-status-bar h1 {
  margin: 0;
  font-size: 1.2em;
  display: flex;
  align-items: center;
}

.top-status-bar h1 img {
  height: 24px;
  margin-right: 10px;
}

.top-status-bar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.top-status-bar nav ul li {
  margin-left: 25px;
  cursor: pointer;
  font-size: 0.95em;
  padding: 5px 0;
  position: relative;
}

.top-status-bar nav ul li::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 50%;
  background-color: white;
  transition: all 0.3s ease-in-out;
  transform: translateX(-50%);
}

.top-status-bar nav ul li:hover::after,
.top-status-bar nav ul li.active::after {
  width: 100%;
}

/* Main Container - Restored to original behavior */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Side Navigation */
.side-nav {
  width: 220px;
  background-color: #ffffff;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  padding-top: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

.side-nav h3 {
  color: #3f51b5;
  padding: 0 20px 10px;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-nav ul li {
  padding: 12px 20px;
  color: #333;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.side-nav ul li:hover,
.side-nav ul li.active {
  background-color: #e8eaf6;
  color: #3f51b5;
}

.side-nav ul li i {
  margin-right: 10px;
  color: #777;
}

.side-nav ul li.active i {
  color: #3f51b5;
}

/* Main Content Area */
.content-area {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  background-color: #f0f2f5;
  box-sizing: border-box;
  /* display controlled by Vue now */
}

.device-controls {
  display: flex;
  gap: 15px; /* 您的原始代码是 15px，这里使用 20px 应该是笔误 */
  /* 移除 flex: 1; */ /* <-- 关键改动 */
  margin-bottom: 15px;
  flex-shrink: 0; /* 保持，防止它在水平方向上收缩 */
  /* 如果需要，可以明确设置宽度适应内容，但通常是默认行为 */
  /* width: fit-content; */
}

.device-controls button {
  padding: 10px 20px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease;
}

.device-controls button:hover {
  background-color: #45a049;
}

.device-controls button.active {
  background-color: #3f51b5;
}

.main-content-panels {
  display: flex;
  gap: 20px;
  flex: 1;
}

/* Left Panel - Modified for 1.5:1 ratio */
.left-panel {
  flex: 3; /* 保持原始的 1.5 比例 */
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px; /* 保持原始 padding */
  display: flex; /* 使用 flex 布局居中内容 */
  justify-content: center; /* 水平居中图片 */
  align-items: center; /* 垂直居中图片 */
  /* overflow: hidden; */
  position: relative; /* 允许内部元素绝对定位，如传感器点和弹窗 */
  min-height: 0; /* 允许在 flex 容器中正确收缩，防止内容溢出 */
}

.device-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* 保持图片比例，适应容器，留白边，不影响容器尺寸 */
  border-radius: 5px;
  display: block; /* 移除图片下方可能存在的额外空间 */
  width: auto; /* 允许自动缩放宽度 */
  height: auto; /* 允许自动缩放高度 */
}

.right-panel {
  flex: 1; /* 保持原始的 1 比例 */
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0; /* 允许在 flex 容器中正确收缩，防止内容溢出 */
}

.overlay-image {
  position: absolute;
  bottom: 20px; /* Adjust as needed for desired spacing from the bottom */
  right: 20px;
  width: 400px;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Sensor Dots Styling - Retained for dynamic positioning */
.sensor-dots {
  position: absolute;
  pointer-events: none;
}

.sensor-dot {
  width: 35px;
  height: 35px;
  background-color: #4caf50;
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
  pointer-events: all;
}

/* Chart Popup Styling - Retained for dynamic positioning */
.chart-popup {
  position: absolute;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  padding: 15px;
  z-index: 20;
  width: 400px;
  height: 250px;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.chart-popup .close-chart-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #555;
  z-index: 21;
}
.chart-popup canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Right Panel - Retains flex: 1 */
.right-panel {
  flex: 1; /* 保持原始的 1 比例 */
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0; /* 允许在 flex 容器中正确收缩，防止内容溢出 */
}

.info-card,
.evaluation-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  flex: 1; /* 让它们各自占据 right-panel 的一半高度 */
  overflow-y: auto;
  display: flex; /* 使内部内容也使用 flex 布局 */
  flex-direction: column;
  min-height: 0;
}

.info-card h3,
.evaluation-card h3 {
  color: #3f51b5;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1em;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.info-content p {
  margin-bottom: 8px;
  font-size: 0.9em;
  color: #555;
}

/* Chart container styling */
.chart-container {
  position: relative;
  height: 380px; /* Fixed height for the chart */
  width: 100%;
  margin-top: 10px;
}
